minimum flips to make a or b equal to c solution in python